package com.cdut.hwadeefsc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

/**
 * 学生评语表
 * @TableName comments
 */
@TableName(value ="comments")
public class comments {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 学生ID (关联 users.id)
     */
    private Long studentId;

    /**
     * 填写评语的老师ID (关联 users.id)
     */
    private Long teacherId;

    /**
     * 学期 (e.g., "2024-2025第一学期")
     */
    private String term;

    /**
     * 评语内容
     */
    private String content;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 学生ID (关联 users.id)
     */
    public Long getStudentId() {
        return studentId;
    }

    /**
     * 学生ID (关联 users.id)
     */
    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    /**
     * 填写评语的老师ID (关联 users.id)
     */
    public Long getTeacherId() {
        return teacherId;
    }

    /**
     * 填写评语的老师ID (关联 users.id)
     */
    public void setTeacherId(Long teacherId) {
        this.teacherId = teacherId;
    }

    /**
     * 学期 (e.g., "2024-2025第一学期")
     */
    public String getTerm() {
        return term;
    }

    /**
     * 学期 (e.g., "2024-2025第一学期")
     */
    public void setTerm(String term) {
        this.term = term;
    }

    /**
     * 评语内容
     */
    public String getContent() {
        return content;
    }

    /**
     * 评语内容
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 创建时间
     */
    public Date getCreatedAt() {
        return createdAt;
    }

    /**
     * 创建时间
     */
    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        comments other = (comments) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStudentId() == null ? other.getStudentId() == null : this.getStudentId().equals(other.getStudentId()))
            && (this.getTeacherId() == null ? other.getTeacherId() == null : this.getTeacherId().equals(other.getTeacherId()))
            && (this.getTerm() == null ? other.getTerm() == null : this.getTerm().equals(other.getTerm()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStudentId() == null) ? 0 : getStudentId().hashCode());
        result = prime * result + ((getTeacherId() == null) ? 0 : getTeacherId().hashCode());
        result = prime * result + ((getTerm() == null) ? 0 : getTerm().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", studentId=").append(studentId);
        sb.append(", teacherId=").append(teacherId);
        sb.append(", term=").append(term);
        sb.append(", content=").append(content);
        sb.append(", createdAt=").append(createdAt);
        sb.append("]");
        return sb.toString();
    }
}